#include "LinearMath/btConvexHull.h"
#ifdef __cplusplus
extern "C" {
#endif
int4* bullet_Newint4(){
	int4* wrap_out = new int4();
	return wrap_out;
}

int4* bullet_Newint41(int _x,int _y,int _z,int _w){
	int c_arg__x=_x;
	int c_arg__y=_y;
	int c_arg__z=_z;
	int c_arg__w=_w;
	int4* wrap_out = new int4(c_arg__x,c_arg__y,c_arg__z,c_arg__w);
	return wrap_out;
}

int bullet_int4_GetFieldOfW(int4* c_this){
	return (int)(c_this->w);
}

int bullet_int4_GetFieldOfX(int4* c_this){
	return (int)(c_this->x);
}

int bullet_int4_GetFieldOfY(int4* c_this){
	return (int)(c_this->y);
}

int bullet_int4_GetFieldOfZ(int4* c_this){
	return (int)(c_this->z);
}

btPlane* bullet_NewbtPlane(btVector3* n,double d){
	btVector3 const& c_arg_n=(btVector3 const&)(*n);
	btScalar c_arg_d=d;
	btPlane* wrap_out = new btPlane(c_arg_n,c_arg_d);
	return wrap_out;
}

btPlane* bullet_NewbtPlane1(){
	btPlane* wrap_out = new btPlane();
	return wrap_out;
}

double bullet_btPlane_GetFieldOfDist(btPlane* c_this){
	return (double)(c_this->dist);
}

btVector3* bullet_btPlane_GetFieldOfNormal(btPlane* c_this){
	return (btVector3*)(&c_this->normal);
}

PHullResult* bullet_NewPHullResult(){
	PHullResult* wrap_out = new PHullResult();
	return wrap_out;
}

unsigned int bullet_PHullResult_GetFieldOfMFaceCount(PHullResult* c_this){
	return (unsigned int)(c_this->mFaceCount);
}

unsigned int bullet_PHullResult_GetFieldOfMIndexCount(PHullResult* c_this){
	return (unsigned int)(c_this->mIndexCount);
}

unsigned int bullet_PHullResult_GetFieldOfMVcount(PHullResult* c_this){
	return (unsigned int)(c_this->mVcount);
}

btVector3** bullet_PHullResult_GetFieldOfMVertices(PHullResult* c_this){
	return (btVector3**)(&c_this->mVertices);
}

HullResult* bullet_NewHullResult(){
	HullResult* wrap_out = new HullResult();
	return wrap_out;
}

unsigned int bullet_HullResult_GetFieldOfMNumFaces(HullResult* c_this){
	return (unsigned int)(c_this->mNumFaces);
}

unsigned int bullet_HullResult_GetFieldOfMNumIndices(HullResult* c_this){
	return (unsigned int)(c_this->mNumIndices);
}

unsigned int bullet_HullResult_GetFieldOfMNumOutputVertices(HullResult* c_this){
	return (unsigned int)(c_this->mNumOutputVertices);
}

bool bullet_HullResult_GetFieldOfMPolygons(HullResult* c_this){
	return (bool)(c_this->mPolygons);
}

HullLibrary* bullet_NewHullLibrary(){
	HullLibrary* wrap_out = new HullLibrary();
	return wrap_out;
}

HullError bullet_HullLibrary_CreateConvexHull(HullLibrary* c_this,HullDesc* desc,HullResult* result){
	HullDesc const& c_arg_desc=(HullDesc const&)(*desc);
	HullResult& c_arg_result=(HullResult&)(*result);
	HullError c_out = c_this->CreateConvexHull(c_arg_desc,c_arg_result);
	HullError wrap_out = (c_out);
	return wrap_out;
}

HullError bullet_HullLibrary_ReleaseResult(HullLibrary* c_this,HullResult* result){
	HullResult& c_arg_result=(HullResult&)(*result);
	HullError c_out = c_this->ReleaseResult(c_arg_result);
	HullError wrap_out = (c_out);
	return wrap_out;
}

HullDesc* bullet_NewHullDesc(){
	HullDesc* wrap_out = new HullDesc();
	return wrap_out;
}

HullDesc* bullet_NewHullDesc1(HullFlag flag,unsigned int vcount,btVector3* vertices,unsigned int stride){
	HullFlag c_arg_flag=flag;
	unsigned int c_arg_vcount=vcount;
	btVector3 const * c_arg_vertices=(btVector3 const *)(void*)(vertices);
	unsigned int c_arg_stride=stride;
	HullDesc* wrap_out = new HullDesc(c_arg_flag,c_arg_vcount,c_arg_vertices,c_arg_stride);
	return wrap_out;
}

void bullet_HullDesc_ClearHullFlag(HullDesc* c_this,HullFlag flag){
	HullFlag c_arg_flag=flag;
	c_this->ClearHullFlag(c_arg_flag);
}

unsigned int bullet_HullDesc_GetFieldOfMFlags(HullDesc* c_this){
	return (unsigned int)(c_this->mFlags);
}

unsigned int bullet_HullDesc_GetFieldOfMMaxFaces(HullDesc* c_this){
	return (unsigned int)(c_this->mMaxFaces);
}

unsigned int bullet_HullDesc_GetFieldOfMMaxVertices(HullDesc* c_this){
	return (unsigned int)(c_this->mMaxVertices);
}

double bullet_HullDesc_GetFieldOfMNormalEpsilon(HullDesc* c_this){
	return (double)(c_this->mNormalEpsilon);
}

unsigned int bullet_HullDesc_GetFieldOfMVcount(HullDesc* c_this){
	return (unsigned int)(c_this->mVcount);
}

unsigned int bullet_HullDesc_GetFieldOfMVertexStride(HullDesc* c_this){
	return (unsigned int)(c_this->mVertexStride);
}

btVector3** bullet_HullDesc_GetFieldOfMVertices(HullDesc* c_this){
	return (btVector3**)(&c_this->mVertices);
}

bool bullet_HullDesc_HasHullFlag(HullDesc* c_this,HullFlag flag){
	HullFlag c_arg_flag=flag;
	bool c_out = c_this->HasHullFlag(c_arg_flag);
	bool wrap_out = (c_out);
	return wrap_out;
}

void bullet_HullDesc_SetHullFlag(HullDesc* c_this,HullFlag flag){
	HullFlag c_arg_flag=flag;
	c_this->SetHullFlag(c_arg_flag);
}

ConvexH::HalfEdge* bullet_NewConvexHHalfEdge(){
	ConvexH::HalfEdge* wrap_out = new ConvexH::HalfEdge();
	return wrap_out;
}

ConvexH::HalfEdge* bullet_NewConvexHHalfEdge1(short _ea,unsigned char _v,unsigned char _p){
	short c_arg__ea=_ea;
	unsigned char c_arg__v=_v;
	unsigned char c_arg__p=_p;
	ConvexH::HalfEdge* wrap_out = new ConvexH::HalfEdge(c_arg__ea,c_arg__v,c_arg__p);
	return wrap_out;
}

short bullet_ConvexHHalfEdge_GetFieldOfEa(ConvexH::HalfEdge* c_this){
	return (short)(c_this->ea);
}

unsigned char bullet_ConvexHHalfEdge_GetFieldOfP(ConvexH::HalfEdge* c_this){
	return (unsigned char)(c_this->p);
}

unsigned char bullet_ConvexHHalfEdge_GetFieldOfV(ConvexH::HalfEdge* c_this){
	return (unsigned char)(c_this->v);
}

ConvexH* bullet_NewConvexH(){
	ConvexH* wrap_out = new ConvexH();
	return wrap_out;
}

ConvexH* bullet_NewConvexH1(int vertices_size,int edges_size,int facets_size){
	int c_arg_vertices_size=vertices_size;
	int c_arg_edges_size=edges_size;
	int c_arg_facets_size=facets_size;
	ConvexH* wrap_out = new ConvexH(c_arg_vertices_size,c_arg_edges_size,c_arg_facets_size);
	return wrap_out;
}

#ifdef __cplusplus
}
#endif
